package com.qdlc.p2p.biz.tpp.model;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.constant.SinaConstant;
import com.qdlc.p2p.common.util.DateUtil;
import com.qdlc.p2p.dal.common.SystemConfigHelper;
import com.qdlc.p2p.dal.common.SystemConfigHelper.Nid;


/**
 * 新浪 - 托管退款
 * @author gcx
 * @version 2.0
 * @date 2015年8月17日 17:54
 */
public class SinaRefund extends SinaModel{
	/**
	 * 交易订单号	 	商户网站交易订单号，商户内部保证唯一
	 */
	private String out_trade_no;

	/**
	 * 需要退款的商户订单号 	需要退款的商户订单号（确保在合作伙伴系统中唯一）。同交易中的一致。
	 */
	private String orig_outer_trade_no ;

	/**
	 * 退款金额		支持部分退款，退款金额不能大于交易金额。 单位为：RMB Yuan，精确到小数点后两位。
	 */
	private String refund_amount;

	/**
	 * 摘要	 		退款原因
	 */
	private String summary;

	/**
	 * 分账信息列表   收款信息列表，参见收款信息，参数间用“^”分隔，各条目之间用“|”分隔，备注信息不要包含特殊分隔符
	 */
	private String split_list;

	/**
	 * 扩展信息		业务扩展信息， 参数格式：参数名1^参数值1|参数名2^参数值2|……
	 */
	private String extend_param;


	/******** 响应信息 start ********/

	/**
	 * 退款状态		退款状态，详见附录“退款状态”
	 */
	private String refund_status;

	/******** 响应信息 end  ********/


	/**
	 * 待签名字符数组
	 */
	private String[] signParamNames = new String[]{"version","service","request_time","partner_id","_input_charset","out_trade_no","orig_outer_trade_no","refund_amount","summary","return_url","notify_url"};

	/**
	 * 提交字符数组
	 */
	private String[] subParamNames = new String[]{"version","service","request_time","partner_id","_input_charset","out_trade_no","orig_outer_trade_no","refund_amount","summary","return_url","notify_url","sign_type","sign"};

	public SinaRefund() {
		super();
	}

	public SinaRefund(String out_trade_no, String orig_outer_trade_no,
			String refund_amount, String summary, String split_list,
			String extend_param) {
		super();
		this.setIdentity_type(SinaConstant.IDENTITY_TYPE_UID);
		this.setRequest_time(DateUtil.dateStr3(DateUtil.getNow()));
		this.out_trade_no = out_trade_no;
		this.orig_outer_trade_no = orig_outer_trade_no;
		this.refund_amount = refund_amount;
		this.summary = summary;
		this.split_list = split_list;
		this.extend_param = extend_param;
		this.setUrl_type(SinaConstant.URL_TYPE_CASH);
		this.setService("create_hosting_refund");
		this.setEncode(SinaConstant.ENCODE_TRUE);
		// 新浪回调地址
		String webUrl = SystemConfigHelper.getValue(Nid.WEB_URL);
		this.setReturn_url(webUrl+"/tpp/tppSinaAction/tppRefundReturn.html");
		this.setNotify_url(webUrl+"/tpp/tppSinaAction/tppRefundNotify.html");
		
	}
	


	public String getOut_trade_no() {
		return out_trade_no;
	}
	public void setOut_trade_no(String out_trade_no) {
		this.out_trade_no = out_trade_no;
	}
	public String getOrig_outer_trade_no() {
		return orig_outer_trade_no;
	}
	public void setOrig_outer_trade_no(String orig_outer_trade_no) {
		this.orig_outer_trade_no = orig_outer_trade_no;
	}
	public String getRefund_amount() {
		return refund_amount;
	}
	public void setRefund_amount(String refund_amount) {
		this.refund_amount = refund_amount;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getSplit_list() {
		return split_list;
	}
	public void setSplit_list(String split_list) {
		this.split_list = split_list;
	}
	public String getExtend_param() {
		return extend_param;
	}
	public void setExtend_param(String extend_param) {
		this.extend_param = extend_param;
	}
	public String getRefund_status() {
		return refund_status;
	}
	public void setRefund_status(String refund_status) {
		this.refund_status = refund_status;
	}
	public String[] getSignParamNames() {
		return signParamNames;
	}
	public void setSignParamNames(String[] signParamNames) {
		this.signParamNames = signParamNames;
	}
	public String[] getSubParamNames() {
		return subParamNames;
	}
	public void setSubParamNames(String[] subParamNames) {
		this.subParamNames = subParamNames;
	}

	
}
